package PolymorphismDemo;

public class Test {
    public static void main(String[] args) {
        Person person = new Person(32,"老王");
        Animal dog = new Dog(2,"黑色");
        Animal cat = new Cat(3,"灰黑色");
        Dog d = new Dog(2,"黑色");
        Cat c = new Cat(3,"灰黑色");
        person.keepPet(d,"骨头");
        person.keepPet(c,"🐟");
        System.out.println("=============================");
        System.out.println();
        person.keepPet1(d,"骨头");
        person.keepPet1(c,"🐟");
        System.out.println("=============================");
        System.out.println();
        person.keepPet(d,"骨头");
        person.keepPet(c,"🐟");
    }
}
